cc.Class({
    extends: cc.Component,

    properties: {
        memberList: {
          default: null,
          type: cc.Node
        },
        member: {
          default: null,
          type: cc.Prefab
        }
    },

    onLoad: function () {
        let self = this;
        var clubArr = [
            // {id: 123456, username: 'sanm', logo: 'http://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJKpp1HCnDWb1TI4zG7mvIYoHjotHJGdTM7dpkACGfueIfQYIBvnCFHQqLca7l3HFHUQCbNARGqdA/132', ip: '192.168.1.1'},
        ]
        //成员列表
        for (var i = 0, len = clubArr.length; i < len; i++) {
            let group = cc.instantiate(self.member);
            let memberGroup = group.getComponent("memberInfo");
            memberGroup.init(clubArr[i]);
            group.parent = self.memberList;
        }
    }
    //,
    // init:function(obj){
    //     this.username.string = obj.name;
    //     this.message.string = obj.ip;
    //     this.showid.string = obj.showid;
    //     var remoteUrl = obj.logo;
    //     let self = this;
    //     if(remoteUrl){
    //         cc.loader.load({url: remoteUrl, type: 'png'}, function (err,tex) {
    //             var spriteFrame = new cc.SpriteFrame(tex, cc.Rect(0, 0, 132, 132));
    //             self.logo.spriteFrame = spriteFrame;
    //         });
    //     }
    // }
});